<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Content-Type:application/json; charset=utf-8');

include_once '../public/con-db.php';
$res = file_get_contents('php://input');

$id = $_POST['id'];
$token = $_POST['token'];

$sql = "UPDATE student SET `id`='$id' WHERE `token`='$token'";
$result = $conn->query($sql);

print_r (json_encode("选课成功"));

?>